<HTML>  
<HEAD>  
<TITLE> New Document </TITLE>  

<script>  
function newelement(){  
var a=document.createElement("a");  
a.href="http://www.baidu.com";  

var img=document.createElement("img") ;
img.src="http://img.baidu.com/img/post-jg.gif";  
img.style.border="none";  
p= document.createElement("p");
p.innerHTML="aaa";
p.style.cssFloat='left';
p.style.textDecoration='underline';
img.style.cssFloat='left'
a.appendChild(img);  a.appendChild(p); 
document.getElementById("oData").appendChild(a);  

img.onmouseover=function(){  
this.src="http://www.baidu.com/img/sslm1_logo.gif";  
}  

img.onmouseout=function(){  
this.src="http://img.baidu.com/img/post-jg.gif";  
}  
}  


</script>  
</HEAD>  
<BODY onload=newelement()>  
         <SPAN ID="oData" ></SPAN>  
</BODY> 